package com.jkoss.dao.kc;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jkoss.pojo.kc.Subject;
import com.jkoss.pojo.kc.SubjectExample;
import com.jkoss.tool.Page;

public interface SubjectMapper {
      

	int countByExample(SubjectExample example);

    int deleteByExample(SubjectExample example);

    int deleteByPrimaryKey(Integer sbid);

    int insert(Subject record);

    int insertSelective(Subject record);

    List<Subject> selectByExample(SubjectExample example);

    Subject selectByPrimaryKey(Integer sbid);

    int updateByExampleSelective(@Param("record") Subject record, @Param("example") SubjectExample example);

    int updateByExample(@Param("record") Subject record, @Param("example") SubjectExample example);

    int updateByPrimaryKeySelective(Subject record);

    int updateByPrimaryKey(Subject record);

    @Select("select a.*,b.kcmdelName from t_subject a,t_coursemodel b where a.kcmdelid=b.kcmdelid ORDER BY a.kcmdelid")
    @RequestMapping("com.jkoss.dao.kc.SubjectMapper.BaseResultMap2")
	List<Subject> findByAll(Page<Subject> page);

	Subject findByOne(@Param("sbid")String sbid);

	@Select("select * from t_subject")
    @RequestMapping("com.jkoss.dao.kc.SubjectMapper.BaseResultMap")
	List<Subject> findByAll2();
    
	 @Select("select a.*,b.kcmdelName from t_subject a,t_coursemodel b where a.kcmdelid=b.kcmdelid and a.kcmdelid=${params.kcmdelid}")
	 @RequestMapping("com.jkoss.dao.kc.SubjectMapper.BaseResultMap2")
	List<Subject> findPageAndKcmid(Page<Subject> page);
}